#include <stdio.h>
#include "common.h"
#include <dlfcn.h>

int main(void)
{
    void* phandle_a = dlopen("./libsuba.so", RTLD_NOW | RTLD_LOCAL);
    void* phandle_b = dlopen("./libsubb.so", RTLD_NOW | RTLD_LOCAL);
    printf("phandle_a = %p, phandle_b = %p\n", phandle_a, phandle_b);

    const char* last_error = dlerror();
    if (NULL != last_error)
    {
        printf("dlerror = %s\n", last_error);
    }

    dlclose(phandle_b);
    dlclose(phandle_a);

    return 0;
}
